<?php

namespace app\admin\model\sale;

use think\Model;


class Clothmaking_customer extends Model
{

    

    

    // 表名
    protected $name = 'clothmaking_customer';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'payment_text'
    ];
    

    
    public function getPaymentList()
    {
        return ['transfer' => __('Transfer'), 'cash' => __('Cash'), 'honour' => __('Honour'), 'check' => __('Check'), 'thirty' => __('Thirty'), 'sixty' => __('Sixty')];
    }


    public function getPaymentTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['payment']) ? $data['payment'] : '');
        $list = $this->getPaymentList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
